/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Pantallasos;

import java.awt.event.KeyEvent;

/**
 *
 * @author Eduardo
 */
public class Perfiles extends javax.swing.JFrame {

    PantallaPrincipalSecretaria pantallaSecretaria;
    PantallaPrincipalEvaluador pantallaEvaluador;
    PantallaPrincipalDirector pantallaDirector;
    PantallaPrincipalAdministrador pantallaAdministrador;
    
    public Perfiles() {
        initComponents();
        this.setVisible(true);
        perfilSecretaria.setSelected(true);
        perfilAdministrador.setSelected(false);
        perfilDirector.setSelected(false);
        perfilEvaluador.setSelected(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        perfilSecretaria = new javax.swing.JRadioButton();
        perfilEvaluador = new javax.swing.JRadioButton();
        perfilDirector = new javax.swing.JRadioButton();
        botonIngresar = new javax.swing.JButton();
        perfilAdministrador = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        perfilSecretaria.setText("Secretaria");
        perfilSecretaria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                perfilSecretariaActionPerformed(evt);
            }
        });
        perfilSecretaria.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                perfilSecretariaKeyPressed(evt);
            }
        });

        perfilEvaluador.setText("Evaluador");
        perfilEvaluador.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                perfilEvaluadorActionPerformed(evt);
            }
        });
        perfilEvaluador.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                perfilEvaluadorKeyPressed(evt);
            }
        });

        perfilDirector.setText("Director");
        perfilDirector.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                perfilDirectorActionPerformed(evt);
            }
        });
        perfilDirector.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                perfilDirectorKeyPressed(evt);
            }
        });

        botonIngresar.setText("Ingresar");
        botonIngresar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonIngresarActionPerformed(evt);
            }
        });

        perfilAdministrador.setText("Administrador");
        perfilAdministrador.setEnabled(false);
        perfilAdministrador.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                perfilAdministradorActionPerformed(evt);
            }
        });
        perfilAdministrador.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                perfilAdministradorKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(perfilDirector)
                            .addComponent(perfilEvaluador)
                            .addComponent(perfilSecretaria)
                            .addComponent(perfilAdministrador)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addComponent(botonIngresar)))
                .addContainerGap(31, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(perfilSecretaria)
                .addGap(18, 18, 18)
                .addComponent(perfilEvaluador)
                .addGap(18, 18, 18)
                .addComponent(perfilDirector)
                .addGap(18, 18, 18)
                .addComponent(perfilAdministrador)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addComponent(botonIngresar)
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void perfilSecretariaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_perfilSecretariaActionPerformed
        if(!perfilSecretaria.isSelected())
            perfilSecretaria.setSelected(true);
        perfilAdministrador.setSelected(false);
        perfilDirector.setSelected(false);
        perfilEvaluador.setSelected(false);
    }//GEN-LAST:event_perfilSecretariaActionPerformed

    private void perfilEvaluadorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_perfilEvaluadorActionPerformed
        if(!perfilEvaluador.isSelected())
            perfilEvaluador.setSelected(true);
        perfilAdministrador.setSelected(false);
        perfilDirector.setSelected(false);
        perfilSecretaria.setSelected(false);
    }//GEN-LAST:event_perfilEvaluadorActionPerformed

    private void perfilDirectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_perfilDirectorActionPerformed
        if(!perfilDirector.isSelected())
            perfilDirector.setSelected(true);
        perfilAdministrador.setSelected(false);
        perfilSecretaria.setSelected(false);
        perfilEvaluador.setSelected(false);
    }//GEN-LAST:event_perfilDirectorActionPerformed

    private void perfilAdministradorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_perfilAdministradorActionPerformed
        if(!perfilAdministrador.isSelected())
            perfilAdministrador.setSelected(true);
        perfilDirector.setSelected(false);
        perfilSecretaria.setSelected(false);
        perfilEvaluador.setSelected(false);
    }//GEN-LAST:event_perfilAdministradorActionPerformed

    private void botonIngresarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonIngresarActionPerformed
        this.setVisible(false);
        if(perfilSecretaria.isSelected())
            pantallaSecretaria = new PantallaPrincipalSecretaria();
        if(perfilEvaluador.isSelected())
            pantallaEvaluador = new PantallaPrincipalEvaluador();;
        if(perfilDirector.isSelected())
            pantallaDirector = new PantallaPrincipalDirector();;
        if(perfilAdministrador.isSelected())
            pantallaAdministrador = new PantallaPrincipalAdministrador();;
        this.dispose();
    }//GEN-LAST:event_botonIngresarActionPerformed

    private void perfilSecretariaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_perfilSecretariaKeyPressed
        if(evt.getKeyCode()==KeyEvent.VK_ENTER){
            this.setVisible(false);
            if(perfilSecretaria.isSelected())
                pantallaSecretaria = new PantallaPrincipalSecretaria();
            if(perfilEvaluador.isSelected())
                pantallaEvaluador = new PantallaPrincipalEvaluador();;
            if(perfilDirector.isSelected())
                pantallaDirector = new PantallaPrincipalDirector();;
            if(perfilAdministrador.isSelected())
                pantallaAdministrador = new PantallaPrincipalAdministrador();;
            this.dispose();
        }
    }//GEN-LAST:event_perfilSecretariaKeyPressed

    private void perfilEvaluadorKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_perfilEvaluadorKeyPressed
        if(evt.getKeyCode()==KeyEvent.VK_ENTER){
            this.setVisible(false);
            if(perfilSecretaria.isSelected())
                pantallaSecretaria = new PantallaPrincipalSecretaria();
            if(perfilEvaluador.isSelected())
                pantallaEvaluador = new PantallaPrincipalEvaluador();;
            if(perfilDirector.isSelected())
                pantallaDirector = new PantallaPrincipalDirector();;
            if(perfilAdministrador.isSelected())
                pantallaAdministrador = new PantallaPrincipalAdministrador();;
            this.dispose();
        }
    }//GEN-LAST:event_perfilEvaluadorKeyPressed

    private void perfilDirectorKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_perfilDirectorKeyPressed
        if(evt.getKeyCode()==KeyEvent.VK_ENTER){
            this.setVisible(false);
            if(perfilSecretaria.isSelected())
                pantallaSecretaria = new PantallaPrincipalSecretaria();
            if(perfilEvaluador.isSelected())
                pantallaEvaluador = new PantallaPrincipalEvaluador();;
            if(perfilDirector.isSelected())
                pantallaDirector = new PantallaPrincipalDirector();;
            if(perfilAdministrador.isSelected())
                pantallaAdministrador = new PantallaPrincipalAdministrador();;
            this.dispose();
        }
    }//GEN-LAST:event_perfilDirectorKeyPressed

    private void perfilAdministradorKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_perfilAdministradorKeyPressed
        if(evt.getKeyCode()==KeyEvent.VK_ENTER){
            this.setVisible(false);
            if(perfilSecretaria.isSelected())
                pantallaSecretaria = new PantallaPrincipalSecretaria();
            if(perfilEvaluador.isSelected())
                pantallaEvaluador = new PantallaPrincipalEvaluador();;
            if(perfilDirector.isSelected())
                pantallaDirector = new PantallaPrincipalDirector();;
            if(perfilAdministrador.isSelected())
                pantallaAdministrador = new PantallaPrincipalAdministrador();;
            this.dispose();
        }
    }//GEN-LAST:event_perfilAdministradorKeyPressed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonIngresar;
    private javax.swing.JRadioButton perfilAdministrador;
    private javax.swing.JRadioButton perfilDirector;
    private javax.swing.JRadioButton perfilEvaluador;
    private javax.swing.JRadioButton perfilSecretaria;
    // End of variables declaration//GEN-END:variables
}
